package action;



import javax.servlet.http.HttpServletRequest;
import modelo.Aluno;
import modelo.dao.AlunoDAO;
import org.apache.struts2.interceptor.ServletRequestAware;

public class RemoverAlunoAction  implements ServletRequestAware{
    
    private HttpServletRequest request;
    
    /**
     *
     * @param request
     */
    @Override
    public void setServletRequest(HttpServletRequest request){
        this.request = request;
    }
    public String execute(){
        int id = Integer.parseInt(request.getParameter("id"));        
        AlunoDAO dao = new AlunoDAO();        
        Aluno aluno = dao.pesquisarPorId(id);
        dao.remover(aluno);
        return "ok";    
    }
}
